﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Xml.Serialization;

using GolfSigma.Inventory.Extension;

namespace GolfSigma.Inventory.Model
{
    [XmlRoot("Reservation")]
    [Serializable]
    public class Reservation
    {
        [XmlAttribute("id")]
        public UInt64 ReservationId { get; set; }

        [XmlElement("ExternalId")]
        public string ExternalId { get; set; }

        [XmlElement("SearchId")]
        public UInt64 SearchId { get; set; }

        [XmlElement("Search")]
        public Search Search { get; set; }

        [XmlElement("TeeTimeId")]
        public UInt64 TeeTimeId { get; set; }

        [XmlElement("TeeTime")]
        public TeeTime TeeTime { get; set; }

        #region Post Parameters

        public Dictionary<string, string> GetPostParamters()
        {
            string prefix = "reservation.";

            // Create our result
            Dictionary<string, string> result = new Dictionary<string, string>();

            result.Add(StringExtension.Prefix("externalId", prefix), ExternalId);
            result.Add(StringExtension.Prefix("searchId", prefix), SearchId.ToString());
            result.Add(StringExtension.Prefix("teeTimeId", prefix), TeeTimeId.ToString());

            // Return the params
            return result;
        }

        #endregion
    }
}
